import axios from 'axios'
import { uniappAdapter, createRequest } from '@zebra-ui/axios-adapter'

// npm i @zebra-ui/axios-adapter axios
const axiosInstance = axios.create({
  baseURL: 'http://localhost:8000',
  timeout: 10000,
  adapter: uniappAdapter
})

axiosInstance.interceptors.request.use((config) => {
  return config;
}, err => {
  return Promise.reject(error);
})

axiosInstance.interceptors.response.use((response) => {
  if(response.status===200){
  return response.data  
  }
  
}, err => {
  return Promise.reject(error);
})

export default axiosInstance